package vfs.persist.association;


import vfs.except.VFSException;
import vfs.filter.VFSFilter;
import vfs.obj.entity.VFSNodeType;
import vfs.obj.entity.VFSNode;
import java.util.Iterator;

/**
 * VFSNodeToNodeTypeManager manages the "has type" relationship 
 * between Nodes and Node types in the storage medium.
 * 
 * @author Matthew Eavenson <durandal@uga.edu>
 */
public interface VFSNodeToNodeTypeManager{

    /**
     * Returns an iterator over all nodes of a specified type,
     * and filtered by a specified filter.
     * 
     * @param nodeType the type of the requested nodes
     * @param filter a filter over the nodes with the specified type
     * @return an iterator over any matching nodes
     */
    Iterator<VFSNode> getNodes(VFSNodeType nodeType, VFSFilter filter) throws VFSException;
    
    /**
     * Returns the type of a specified node.
     * 
     * @param node the node whose type is requested
     * @return the type of the specified node
     */
    VFSNodeType getNodeType(VFSNode node) throws VFSException;
    
    /**
     * Sets the type of a specified node to a specified node type.
     * 
     * @param node the node whose type will be set
     * @param nodeType the type to assign to the specified node
     */
    void setNodeType(VFSNode node, VFSNodeType nodeType) throws VFSException;
    
}